<template>
	<view class="page">
		<view class="body">
			<view class="image">
				<image src="../../static/pay_statsu/zhifuchenggong.png" mode="" class="img" v-if="isSucceed"></image>
				<image src="../../static/pay_statsu/zhifushibai.png" mode="" class="img" v-else></image>
			</view>
			<view class="img_text">
				{{isSucceed?'支付成功':'支付失败'}}
			</view>
			<view class="money">
				￥{{money}}
			</view>
			<view class="cont justify-content-start">
				<view class="cont_left">
					当前状态
				</view>
				<view class="cont_right">
					{{isSucceed?'支付成功':'支付失败'}}
				</view>
			</view>
			<view class="cont justify-content-start">
				<view class="cont_left">
					支付时间
				</view>
				<view class="cont_right">
					{{paytime}}
				</view>
			</view>
			<view class="cont justify-content-start">
				<view class="cont_left">
					商品
				</view>
				<view class="cont_right">
					{{shop_name}}
				</view>
			</view>
			<view class="cont justify-content-start">
				<view class="cont_left">
					支付方式
				</view>
				<view class="cont_right">
					{{pay_way=="minwechat"?'微信':'支付宝'}}
				</view>
			</view>
			<view class="cont justify-content-start">
				<view class="cont_left">
					订单编号
				</view>
				<view class="cont_right">
					{{order_sn}}
				</view>
			</view>
		</view>
		<!-- 精选服务 -->
		<view class="serve">
			<view class="">
				精选服务
			</view>
			<view class="image">
				<image src="../../static/create/banner .png" mode="" class="img"></image>
			</view>
		</view>
		<!-- 客户支持 -->
		<view class="client">
			<view class="">
				客户支持
			</view>
			<view class="client_cont">
				<text class="client_cont_body" v-for="(item,index) in list" :key="item.index">
					{{item.text}}
				</text>
			</view>
			<view class="client_cont_bto">
				客户服务热线：{{phone}}
			</view>
		</view>
		<view class="btn btn_css" @click="btn">
			完成
		</view>
		<view class="btn_bto">
			本服务由淘物熊商城提供
		</view>
	</view>
</template>

<script>
	import {
		GetOrderinfo
	} from '../../api/index/index.js'
	export default {
		data() {
			return {
				isSucceed: true,
				list: [{
						id: 0,
						text: "在线客服"
					},
					{
						id: 1,
						text: "公众号"
					},
					{
						id: 2,
						text: "抖音"
					},
					{
						id: 3,
						text: "微博"
					},
				],
				order_sn: '',
				money: '',
				shop_name: '',
				pay_way: '',
				phone: '',
				paytime: ''
			}
		},
		onLoad(e) {
			this.order_sn = e.order_sn;
			this.init();
		},
		methods: {
			init() {
				var data = {
					order_sn: this.order_sn
				};
				GetOrderinfo(data).then(res => {
					this.money = res.data.pay_fee;
					this.shop_name = res.data.goods_title;
					this.pay_way = res.data.pay_type;
					this.paytime = res.data.paytime;
					this.phone = res.data.customer_tel;
				})
			},
			btn() {
				uni.reLaunch({
					url: '/pages/index/index'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.page {
		min-height: 100%;

		.body {
			.image {
				width: 80px;
				height: 92px;
				margin: 0 auto;

				.img {
					width: 100%;
					height: 100%;
				}
			}

			.img_text {
				text-align: center;
			}

			.money {
				padding: 10rpx;
				text-align: center;
				border-bottom: 1px solid #f2f2f2;
			}

			.cont {
				padding: 15rpx 0;

				.cont_left {
					width: 200rpx;
					color: #9f9f9f;
				}

				.cont_right {
					width: 500rpx;
					white-space: nowrap;
					overflow: hidden;
					text-overflow: ellipsis;
				}
			}
		}

		.serve {
			margin: 30rpx;

			.image {
				margin-top: 30rpx;
				height: 95px;
				width: 360px;

				.img {
					width: 100%;
					height: 100%;
				}
			}
		}

		.client {
			margin: 30rpx;

			.client_cont {
				margin-top: 30rpx;

				.client_cont_body {
					border: 1px solid #bcbcbc;
					padding: 5px 10px;
					border-radius: 30rpx;
					margin-right: 10px;
					color: #bcbcbc;
				}
			}

			.client_cont_bto {
				margin-top: 30rpx;
				font-size: 12px;
				color: #bcbcbc;
			}
		}

		.btn_css {
			margin-top: 50px;
		}

		.btn_bto {
			margin-top: 30rpx;
			font-size: 12px;
			color: #bcbcbc;
			text-align: center;
		}
	}
</style>